<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">

	var keyword = null;
	var url = null;

	//显示详细页面
	function showDetailPage(keyword){
		url = getAction('initDetail');
		url = url + '&keyword=' + keyword;
		top.windowOpen(url, 'DetailPage', '派工单详细', 400, 650);
	}

	//打印
	function printDispatch(){
		var urlPrint = '${ctx}/applets/appletShow.jsp?reportName=perItemDispatch&keyword=' + keyword;
		$('printFrom').action = urlPrint;
		$('printFrom').submit();
	}

	//选择项
	function selectItem(selectId){
		keyword = selectId;
		if(typeof(parent.setIdAndUrl)=='function'){
		parent.setIdAndUrl(selectId,null);
		}
	}

	//取得Action
	function getAction(method){
		return '${ctx }/occupation_perfectItemDispatchAction.do?method=' + method;
	}

	//导入
	function showImport(){
		url = getAction('initImport')+ '&keyword=' + keyword;
		top.windowOpen(url, 'import', '导入文件', 180, 400,true,"importFrame");
	}

	//导出
	function showExport(arefObj){
		url = getAction('exportFile')+ '&keyword=' + keyword;
		arefObj.href = url;
		arefObj.click();
	}
	//刷新
	function refresh(){
		parent.refresh();

		keyword = null;
		parent.setIdAndUrl(null,null);
	}

	function setSize() {
	  	parent.window.document.all('perfectItemDispatchList').style.height=document.body.scrollHeight;
	}

	function registerCompPerItem(){
	var url = "${ctx}/occupation_perfectItemDispatchAction.do?method=registerCompPerItemPage&keyword="+ keyword;
		top.windowOpen(url, "registerCompPerItem", "完工登记", 450, 700,true,"registerCompPerItem");
	}

	function rightMenu(event){
    if(parent.window.document.all('perfectItemDispatchList')==null)return false;

	return ShowContextMenu(event,'quick_rightmenu');
	}



</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>整改派工列表</title>
</head>
<body onload="setSize();">
<div class="pageNav_bg" >
<form id="printFrom" name="printFrom" action="" method="post" target="_blank"></form>


<ec:ceTable items="perfectItemDispatchList" action="${ctx}/occupation_perfectItemDispatchAction.do?method=queryPerItemDispaListPage" var="item" view="pmsview" styleClass="gridData2" rowsDisplayed="15">
	<ec:ceRow styleClass="grid" ondblclick="javascript:showDetailPage(${item.keyword });" onclick="javascript:selectItem('${item.keyword}');" onContextMenu="return rightMenu(event)">
		<ec:ceColumn headerCell="pmsHeadrCell" title="派工单号" property="dispatchNumber"   width="25%" sortable="true"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="承包商" property="contractorInfoConfigName"   width="20%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="派工日期" property="dispatchDate"  width="20%" sortable="true"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="完工状态" property="completeStatuzName"   width="10%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="备注" property="description"   width="25%"/>
	   <ec:parameter name="contractorInfoId" value="${contractorInfoId}"></ec:parameter>
	   <ec:parameter name="houseId" value="${houseId}"></ec:parameter>
	</ec:ceRow>
</ec:ceTable>

<div id="quick_rightmenu" style="dipplay:1#;" oncontextmenu="return false" class="quick_menu2" onMouseOver="showmy2menu('quick_rightmenu')"  onMouseOut="hidden2menu('quick_rightmenu')" >
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="grid_quickMenu_bg">
    <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
<pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=addPerfectItemDispatch">
		  <tr>
          <td class="quickMenu_toolbarico"><a href="#"  onClick="parent.showEditPage(false);return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新建"/>&nbsp;新 增</a></td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=editPerfectItemDispatch">
        <tr>
          <td class="quickMenu_toolbarico"><a href="#"  onClick="parent.showEditPage(true);return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="修改"/>&nbsp;修 改</a></td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=deletePerfectItemDispatch">
        <tr>
          <td class="quickMenu_toolbarico"><a href="#" onClick="parent.itemDelete();return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 删
            除</a></td>
        </tr>
       </pms:AuthTag>
       <pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=registerCompPerItem">
         <tr>
		   <td class="hrpading"><table width="95%" border="0" align="left" cellpadding="0" cellspacing="0">
		     <tr><td class="quickMenu_line"></td></tr></table></td>
          </tr>

		  <tr>
         <td class="quickMenu_toolbarico"><a href="#" onFocus="this.blur()" onClick="registerCompPerItem();return false;"><img src="${ctx}/images/ico_yhhk_gh.gif" alt="完工登记" border="0" align="absbottom"/>&nbsp;完工登记</a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=checkImportExcelFile">
		  <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#" onClick="showImport();">
          		<img src="${ctx}/images/ico_excel_ru.gif" border="0" align="absbottom" alt=" "/>
          			&nbsp;结果导入
          	</a>
          </td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=exportFile">
		  <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#" onclick="showExport(this);" onFocus="this.blur()" target="showErroeFrame">
          		<img src="${ctx}/images/ico_excel.gif" border="0" align="absbottom" alt=" "/>
          			&nbsp;导 出
          	</a>
          </td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="button.report.perItemDispatch">
		  <tr>
		   <td class="hrpading"><table width="95%" border="0" align="left" cellpadding="0" cellspacing="0">
		     <tr><td class="quickMenu_line"></td></tr></table></td>
          </tr>
		  <tr>
          <td class="quickMenu_toolbarico"><a href="#" onFocus="this.blur()" onClick="printDispatch();return false;"><img src="${ctx}/images/ico_printer.gif" border="0" align="absbottom" alt=" "/>&nbsp;打 印</a></td>
          </tr>
          </pms:AuthTag>
      </table></td>
    </tr>
  </table>
<script type="text/javascript">

	var div1=document.getElementById('quick_rightmenu');
	if(div1.getElementsByTagName("tr").length==1){
	div1.innerHTML="";
	}
</script>
</div>
</div>

<iframe id="showErroeFrame" name="showErroeFrame" style="display:none"></iframe>

</body>
</html>